home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / IFC_112 / netscape / application / Scrollable.java < prev    next >
Encoding:
Text File  |  1999-05-28  |  1.9 KB  |  51 lines  |  [TEXT/CWIE]

  1. // ScrollingTarget.java
  2. // By Ned Etcode
  3. // Copyright 1995, 1996, 1997 Netscape Communications Corp.  All rights reserved.
  4.  
  5. package netscape.application;
  6.  
  7. /** Interface for objects interested in being controlled by a ScrollBar, such
  8.   * as a ScrollView.
  9.   * @see ScrollBar
  10.   * @see ScrollView
  11.   * @see ScrollGroup
  12.   */
  13. public interface Scrollable {
  14.     /** Axis value indicating a Horizontal scroller. */
  15.     public static final int HORIZONTAL = 0;
  16.  
  17.     /** Axis value indicating a Vertical scroller. */
  18.     public static final int VERTICAL = 1;
  19.  
  20.     /** This method should return the total length of the visible scroll area.
  21.       * This length determines the percent visible area, which sets the
  22.       * scroller knob size.  <b>axis</b> indicates the scrolling direction,
  23.       * either VERTICAL or HORIZONTAL.
  24.       */
  25.     public int lengthOfScrollViewForAxis(int axis);
  26.  
  27.     /** This method should return the total length of the View being scrolled.
  28.       * This length determines the percent visible area, which sets the
  29.       * scroller knob size.  <b>axis</b> indicates the scrolling direction,
  30.       * either VERTICAL or HORIZONTAL.
  31.       */
  32.     public int lengthOfContentViewForAxis(int axis);
  33.  
  34.     /** This method should return the visible scroll area's origin
  35.       * relative to the origin of the View being scrolled.  This position
  36.       * determines the scroller knob's position.  <b>axis</b> indicates the
  37.       * scrolling direction, either VERTICAL or HORIZONTAL.
  38.       */
  39.     public int positionOfContentViewForAxis(int axis);
  40.  
  41.     /** This method tells the Scrollable to change the origin of the View
  42.       * it's scrolling to (<b>x</b>, <b>y</b>)
  43.       */
  44.     public void scrollTo(int x, int y);
  45.  
  46.     /** This method tells the Scrollable to move the origin of the View
  47.       * it's scrolling by (<b>deltaX</b>, <b>deltaY</b>)
  48.       */
  49.     public void scrollBy(int deltaX, int deltaY);
  50. }
  51.